package com.example.administrator.daydayappmarket.utils;

import android.content.Context;
import android.support.v7.app.AlertDialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import com.example.administrator.daydayappmarket.R;
import com.example.administrator.daydayappmarket.list.activity.ListSecondBodyActivity;

/**
 * User: 东哥哥
 * Date: 2016/12/29
 * Time: 17:13
 * Project: DayDayAppMarket
 * Describe：
 */


public class MoreDialog {

    private Context context;

    public MoreDialog(Context context) {
        this.context = context;
    }

    public void listSceondmoreDialog() {
        final AlertDialog alertDialog=new AlertDialog.Builder(context, R.style.list_second_draw_dialog).create();
        View view1= LayoutInflater.from(context).inflate(R.layout.list_second_body_dialog_more,null);
        alertDialog.setView(view1);

        //底部出现的动画
        Window window = alertDialog.getWindow();
        window.setGravity(Gravity.BOTTOM);  //此处可以设置dialog显示的位置
        window.setWindowAnimations(R.style.mystyle);
        alertDialog.show();

        //xx监听器 实现退出对话框
        ImageView imageView= (ImageView) view1.findViewById(R.id.list_second_body_dialog_more_imageview);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                alertDialog.dismiss();
            }
        });
    }

}
